package com.example.flow.flow.model;


import com.example.flow.flow.FlowConstant;
import com.example.flow.flow.core.Execution;

/**
 * @author tangaq
 * 2023/6/13
 */
public class EndModel extends NodeModel {
    private static final long serialVersionUID = -8887268350440716311L;

    public EndModel() {
        this.setName(FlowConstant.NODE_END);
    }

    @Override
    protected void exec(Execution execution) {
        execution.getEngine().getOrderService().complete(execution.getOrder().getOrderId());
        doPostIntercept(execution);
    }

    @Override
    public TransitionModel getNextNode() {
        return null;
    }
}
